package rolesystem.roles.auction;

import rolesystem.core.RoleAction;
import rolesystem.roles.KnownEvent;

/**
 * This role is the seller of an auction.
 * Keywords: auction, seller.
 */
public abstract class Seller
{
	/**
	 * Role identifier.
	 */
	public static final String ROLE_ID="auction.Seller";


	/**
	 * An auctioneer notifies that my sale has been accepted.
	 * Sender role: Auctioneer
	 */
	public static final KnownEvent KE_saleAccepted=new KnownEvent("saleAccepted", Auctioneer.ROLE_ID);

	/**
	 * An auctioneer notifies that my sale has been refused.
	 * Sender role: Auctioneer
	 */
	public static final KnownEvent KE_saleRefused=new KnownEvent("saleRefused", Auctioneer.ROLE_ID);

	/**
	 * An auctioneer notifies that my good is unsold.
	 * Sender role: Auctioneer
	 */
	public static final KnownEvent KE_unsold=new KnownEvent("unsold", Auctioneer.ROLE_ID);

	/**
	 * An auctioneer pays.
	 * Sender role: Auctioneer
	 * Content: Payment.
	 */
	public static final KnownEvent KE_pay=new KnownEvent("pay", Auctioneer.ROLE_ID, Money.class);


	/**
	 * Requests to put a good on sale.
	 * @param addressee Auctioneer
	 */
	public static RoleAction reqSale(int addressee)
	{
		return new RoleAction("reqSale", addressee);
	}

	/**
	 * Puts a good on sale.
	 * @param addressee Auctioneer
	 * @param content Characteristics of the sale, i.e. reserve price, good on sale and its description.
	 */
	public static RoleAction putOnSale(int addressee, Sale content)
	{
		return new RoleAction("putOnSale", addressee, content);
	}
}
